cmake_minimum_required(VERSION 3.0.2)
project(clientToService)

## Compile as C++11, supported in ROS Kinetic and newer
add_compile_options(-std=c++11)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin)

set(CMAKE_BUILD_TYPE Release)
MESSAGE("Build type:  " ${CMAKE_BUILD_TYPE})

include_directories(
 ${PROJECT_SOURCE_DIR}/include

)
link_directories(
 ${PROJECT_SOURCE_DIR}/lib
)

find_package(OpenCV 3 REQUIRED)
# set libs
set(LIBS 
 ${OpenCV_LIBS}
 /lib/x86_64-linux-gnu/libpthread.so.0   # need modify
)

# add json support
add_library(${PROJECT_NAME} SHARED 
  src/clientToService.cpp
  src/jsoncpp.cpp
)
target_link_libraries(${PROJECT_NAME}
  ${LIBS}
)

#3
add_executable(test_${PROJECT_NAME}
  ${PROJECT_SOURCE_DIR}/clientToService_test.cpp
)
target_link_libraries(test_${PROJECT_NAME}
   ${PROJECT_NAME}
)